package com.ljp.usercenter.service;

import com.ljp.usercenter.model.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ljp.usercenter.model.request.UserUpdatePasswordRequest;

import javax.servlet.http.HttpServletRequest;

/**
* @author 22493
* @description 针对表【user(用户表)】的数据库操作Service
* @createDate 2023-04-27 16:31:28
*/
public interface UserService extends IService<User> {



    /**
     * 用户注册
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param checkPassword 校验密码
     * @param planetCode 星球编码
     * @return 新用户id
     */
    long userRegister(String userAccount,String userPassword,String checkPassword,String planetCode);

    /**
     * 用户登录
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @return 返回脱敏后的用户信息
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 用户脱敏
     * @param user
     * @return
     */
    User getSafetyUser(User user);

    /**
     * 用户注销
     * @param request
     */
    int userLogout(HttpServletRequest request);

    /**
     *获取当前登录用户
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     *修改密码
     * @param updatePasswordRequest
     * @param request
     * @return
     */
    boolean updateUserPassword(UserUpdatePasswordRequest updatePasswordRequest,HttpServletRequest request);
}
